import { dictionaryList } from '@/api/public'
const app = {
  state: {
    dictionaryList: {} // map 字典
  },
  mutations: {
    SET_DICTIONARY_LIST: (state, dictionaryList) => {
      state.dictionaryList = dictionaryList
    }
  },
  actions: {
    GetDictionaryList({ commit, state }) {
      return new Promise((resolve, reject) => {
        dictionaryList().then(response => {
          const data = response.data
          commit('SET_DICTIONARY_LIST', data)
          resolve(response)
        }).catch(error => {
          reject(error)
        })
      })
    }
  }
}
export default app
